#pragma comment(linker, "/STACK:10000000")
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
#include <cstdio>
#include <cassert>
#include <string>
#include <cstring>
#define ldb double
#define LL long long
#define fi first
#define se second
#define fill(a, c) memset(a, c, sizeof(a))
#define sqr(a) ((a) * (a))
#define nextLine() {int c = 0; while((c = getchar()) != 10 && c != EOF);}
#define getBit(mask, k) (((mask) / pw[k]) % pw[1])
#define setBit(mask, k, l) (((mask) / pw[k + 1] * pw[1] + (l)) * pw[k] + ((mask) % pw[k]))
#define debug(a) cerr << #a << " = " << a << " ";
#define debugl(a) cerr << #a << " = " << a << "\n";
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define ff first
#define ss second 
const ldb LDINF = 9128739847123.00;
const ldb eps = 1e-9;
const int inf = 1 << 28;
const ldb pi = fabsl(atan2l(0.0, -1.0));
using namespace std;
#define MAX_NODES_SZ 3000001

int maxh, q;
ldb pw[32];

class Node
{
	public:
		Node *l, *r;
		int ind, val, sum;
		Node()
		{
			ind = 0;
			val = 0;
			sum = 0;
			l = r = NULL;
		}
		Node(int id, Node *l, Node *r)
		{
			val = 0;
			sum = 0;
			ind = id;
			this -> l = l;
			this -> r = r;
			upd();
		}
		void upd()
		{
			sum = val;
			if (l) sum += l -> sum;
			if (r) sum += r -> sum;
		}
};


Node *root;
Node freenodes[MAX_NODES_SZ];
int freenodes_sz;

Node * getNode()
{
	if (freenodes_sz == MAX_NODES_SZ) throw 42;
 	Node * t = &freenodes[freenodes_sz++];
 	return t;
}

Node *getNode(int id, Node *l, Node *r)
{
	Node *t = getNode();
	t -> l = l;
	t -> r = r;
	t -> ind = id;
	t -> upd();
	return t;
}

void add(Node *&t, int id, int h, int x)
{
	if (t == NULL)
		t = getNode(id >> (h + 1), NULL, NULL);
	if (t -> ind == id)
	{
		t -> val += x;
		t -> sum += x;
		return;
	}
	else if (id & (1 << h))
	{
		add(t -> r, id, h - 1, x);
		t -> upd();
	}
	else
	{
		add(t -> l, id, h - 1, x);
		t -> upd();
	}
}

int cnt(Node *t)
{
	if (t) return t -> sum;
	return 0;
}

ldb getCount(Node *t, int up_mx, int h)
{
	if (t == NULL)
		return pw[h] * up_mx;
	if (t -> sum < up_mx)
		return pw[h] * up_mx;
	else return getCount(t -> l, max(up_mx, cnt(t -> r) + t -> val), h + 1)
	+ getCount(t -> r, max(up_mx, cnt(t -> l) + t -> val), h + 1);
}


int len(int mask)
{
	int r = 0;
	while (mask)
	{
		r++;
		mask >>= 1;
	}
	return r;
}


void load()
{
	char c;
	int v, x;

	cin >> maxh >> q;
	nextLine();
	
	root = getNode(1, NULL, NULL);
	pw[0] = 1;
	for (int i = 1; i <= maxh + 1; i++)
		pw[i] = pw[i - 1] * 0.5;

	for (int i = 0; i < q; i++)
	{
		c = getchar();
		if (c == 'a')
		{
			getchar(); getchar();
			scanf("%d%d", &v, &x);
		//	cerr << "add " << v << " " << x << "\n";
			add(root, v, len(v) - 2, x);
		}
		else 
		{
		//	cerr << "decat\n";
		    printf("%.6lf\n", getCount(root, 0, 0));
		}
		nextLine();
	}
	cerr << freenodes_sz;
}

void solve()
{

}

#define file "d"
int main()
{
	#ifndef ONLINE_JUDGE
		freopen(file".in", "rt", stdin);
		freopen(file".out", "wt", stdout);
	#endif
	load();
	solve();
	return 0;
}
